<?php get_header(); ?>

		<section id="mainColumn">
			<h1>
				<a href="#"><?php print get_option('blog_name'); ?></a>
			</h1>

<?php
$closed = TRUE;
if (have_posts()) :
$counter = 1;
   while (have_posts()) :
      the_post();
if( $counter == 1 ) {
// latest post should appear differently, as a "teaser"
?>
		<article id="teaser" class="marginLeftAndRight horizontalDottedLine">
				<div>
					
					<h3><?php the_title(); ?></h3>
					<p>
						<?php echo get_the_excerpt(); ?>
						<a id="teaserReadMore" href="<?php the_permalink(); ?>">Read more...</a>
					</p>
				</div>
				<div id="teaserFooter">
					<a class="footer" href="#"><?php the_date(); ?> by <?php the_author(); ?></a>
					<span>000 views</span>
				</div>
			</article>
<?php
} else {

/*here the code to show all other posts*/
?>

<?php if($closed) { ?>
<?php if($counter > 2) { // add the closing div of the previous post ?></div><?php }?>
<div class="footer ">
				<div class="articles">
					<article class="floatLeft verticalLine horizontalHiddenLine">
						<h3><?php the_title(); ?></h3>
						<p><?php echo get_the_excerpt(); ?> <a id="teaserReadMore" href="<?php the_permalink(); ?>">Read more...</a></p>
					</article>
<?php $closed=FALSE;} else { ?>
					<article class="floatLeft">
						<h3><?php the_title(); ?></h3>
						<p><?php echo get_the_excerpt(); ?> <a id="teaserReadMore" href="<?php the_permalink(); ?>">Read more...</a></p>
					</article>
				</div>
			
<?php $closed=TRUE; } ?>
<?php
}
$counter++;
   endwhile;
endif;

if(!$closed) { 
// Add two divs if the number of posts is even. In this case,
// the articles div consists of one article and not two, hence the addition.
?> 
		<article class="floatLeft">
		</article>
		</div>
		<div id="readMore">
			<a href="#">Load more...</a>		
		</div>
	</div>
<?php	
} else {
?>
		<div id="readMore">
			<a href="#">Load more...</a>		
		</div>
</div>
<?php
}
?>
		</section>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
